<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{lang u_reg_ok}-{lang u_waiting_activation}</title>
<link href="{TPL}css/Register.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="{TPL}css/NewTopFoot.css"  />
<script src="{TPL}js/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{TPL}js/Gobal.js"> </script>
</head>

<body>
{template 'header'}
<div class="box">
        <script type="text/javascript">
 
            function emailInputShow(e) {
                if (e && e.stopPropagation) {
                    e.stopPropagation();
                }
                else {
                    window.event.cancelBubble = true;
                }
                $('#bgdiv').show();
                $("#changeEmail").show(0, function() { $("#codeImage").click(); });
                $("#changeEmailCode").val("");
                $("#cEmail").removeAttr("class").text("{lang u_email_instr}");
                $("#cemailinput").val("");
            }
 
            function changeEmail(e) {
                if (e && e.stopPropagation != undefined) { e.stopPropagation(); }
                else { window.event.cancelBubble = true; }
 
                var checkCode = $.trim($("#changeEmailCode").val());
                if (checkCode.length <= 0) {
                    $("#cEmail").attr("class", "red").text('{lang u_email_instr}'); return;
                }
 
                $.ajax({
                    type: "POST",
                    url: "/ajax/user_ajax.php?action=checkcode&code=" + checkCode,
                    dataType: "text",
                    timeout: 5000,
                    error: function(a, b, c) { checkcodechecked = true; $("#cEmail").removeAttr("class").text('{lang u_email_instr}'); changeEmailSuc(); },
                    success: function(msg) {
                        if (msg == '0') {
                            $("#cEmail").attr("class", "red").text('{lang u_code_error}'); return;
                        }
                        else {
                            $("#cEmail").removeAttr("class").text('{lang u_email_instr}');
                            changeEmailSuc();
                        }
                    }
                });
            }
 
 
            function changeEmailSuc() {
                var email = $("#cemailinput").val();
                if (email.length <= 0) { $("#cEmail").attr("class", "red").text("{lang u_email_recomm}"); return; }
                var reg = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
                if (reg.test($("#cemailinput").val())) {
                    $.ajax({
                        type: "POST",
                        url: "/ajax/user_ajax.php?action=changeemail",
                        dataType: "json",
                        contentType: "application/json;utf-8",
                        data: "{'email':'" + email + "'}",
                        timeout: 10000,
                        beforeSend: function() { $("#cEmail").attr("class", "lv").text("{lang u_email_recomm}"); $("#changeEmailBtn").attr("disabled", "disabled"); },
                        error: function() { $("#cEmail").attr("class", "red").text("{lang u_internet_fild}"); $("#changeEmailBtn").removeAttr("disabled"); },
                        success: function(res) {
                            var rstr = res;
                            if (rstr == "OK" || rstr == "fail") { $("#cEmail").text("{lang u_email_reset_notice}"); $("#changeEmail").hide(); $("#registerEmail").html(email); $("#successChange").show(); }
							else{
								{ $("#cEmail").attr("class", "red").text(rstr); }
							}
                            $("#changeEmailBtn").removeAttr("disabled");
                        }
                    });
                }
                else {
                    $("#cEmail").attr("class", "red").text("{lang u_email_error}");
                }
            }
 
            function reSendEmail() {
                $.ajax({
                    type: "POST",
                    url: "/ajax/user_ajax.php?action=resendemail",
                    dataType: "json",
                    contentType: "application/json;utf-8",
                    data: "{'uname':'{$regNickName}'}",
                    timeout: 50000,
                    error: function() { alert("{lang u_internet_fild}"); },
                    success: function(res) { var resStr = res; if (resStr == "OK") { alert("{lang u_email_reset_notice}"); } else { if (resStr == "again") alert("{lang u_email_freq_notice}"); else { if (resStr == "approved") { alert("{lang u_account_active_notice}"); window.location = "/user.php?action=login" } else alert("{lang u_email_active_fail_notice}"); } } }
                });
            }
 
            $(document).ready(function() {
                $("#changeEmail").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
                $("#successChange").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
                $(document).click(function(e) {
                    if ($("#changeEmail:hidden").length > 0) {
                        //if ($.trim($("#cemailinput").val()).length == 0) $("#cemailinput").attr("class", "c1").val("请输入Email地址");
                        $("#cEmail").removeAttr("class").text("{lang u_panli_notice}");
                    } $("#changeEmail").hide(); $('#bgdiv').hide(); $("#successChange").hide();
                });
            });
        </script>





              <div class="move">
            <img alt="{lang Activation_account}" src="{TPL}images/move2.gif"></div>
        <div class="activation">
            <div class="mail">
                <h2>
                    {lang u_system_has_been}<span id="registerEmail">{$regEmail}</span>{lang u_send_verify_email}</h2>
                <dl>
                    <dt>{lang u_click_complete}！</dt>
                    
                    <dd>
                        <a target="_blank" href="{$emailhttp}">{lang u_go_email}</a></dd>
                </dl>
            </div>
            <div class="operate">
                <h2>
                    {lang u_try_recomm}：</h2>
                <ul>
                    <li>{lang u_view_email_mis}；</li>
                    <li>{lang u_resend_recomm}<a onclick="reSendEmail()" href="javascript:void(0);">{lang u_resend}</a>；</li>
                    <li>{lang u_also_recomm}<a href="javascript:void(0);" onclick="emailInputShow(event)">{lang u_modify_email}</a>,{lang u_receive_notice}。</li>
                </ul>
                <div style="display: none;" id="bgdiv" class="floor">
                </div>
                <div style="display: none;" class="change" id="changeEmail">
                    <a title="{lang Close}" class="close" onclick="$('#changeEmail').hide();$('#bgdiv').hide();" href="javascript:;"></a>
                    <p id="cEmail">
                       {lang u_email_as_username}!</p>
                    <table>
                        <tbody><tr>
                            <td class="zuo">
                               {lang u_email}：
                            </td>
                            <td>
                                <input type="text" class="c1" id="cemailinput">
                            </td>
                        </tr>
                        <tr>
                            <td class="zuo">
                                {lang u_code}：
                            </td>
                            <td>
                                <input type="text" id="changeEmailCode" class="c3"><img border="0" onclick="var now=new Date();this.src='includes/code/securimage_show.php?sid={echo md5(time())}&amp;w=92&amp;h=30&amp;t='+Math.random();" style="vertical-align: middle; cursor: pointer;" alt="{lang u_code}" title="{lang u_refresh_code}" src="includes/code/securimage_show.php?sid={echo md5(time())}&amp;w=92&amp;h=30&amp;t='+Math.random();" id="codeImage">
                            </td>
                        </tr>
                    </tbody></table>
                    <input type="button" onmouseout="this.className='c2'" onmouseover="this.className='c2_'" value="{lang Sure_send}" name="" onclick="changeEmail(event);" class="c2" id="changeEmailBtn">
                </div>
                <div style="display: none;" class="change" id="successChange">
                    <a title="{lang Close}" class="close" onclick="$('#successChange').hide();$('#bgdiv').hide();" href="javascript:;"></a>
                    <div class="ch_top">
                        {lang u_system_has_been}{lang u_send_verify_email}!<br>
                        {lang u_click_complete}！
                    </div>
                    <p class="tishi">
                        {lang u_email_as_username}!</p>
                </div>
            </div>
        </div>
        
    </div>
  <div class="bottom_1">
    </div>

{template 'footer'}
</body>
</html>